Conversation
|
@Kaiido FYI since you asked about this. Device pixels is wrong, or only true if you also size the canvas to match the pixel size reported by ResizeObserver, which is a good idea. |
| // dimensions in device pixels | ||
| readonly attribute unsigned long width; | ||
| readonly attribute unsigned long height; | ||
| // dimensions scaled such that when drawing to canvas, the element will appear |
There was a problem hiding this comment.
Can we call this "intrinsic size" and define it as a first-class concept? It's a subtle enough concept that we had a lengthy discussion about it. The definition would be something like:
"the size, in canvas coordinate space, at which an Element or ElementImage will have the same proportions when drawn into the canvas as it would have were it placed outside the canvas with the same ComputedStyle."
These attributes can then simply be described as "intrinsic size of the element", and we would refer to the "intrinsic size" concept again in the IDL for drawElementImage, because that's the size we will use if the optional destination size parameters are omitted.
There was a problem hiding this comment.
The concept definition of "intrinsic size" could also contain polyfill code to compute it based on canvas.(width|height) and canvas.client(Width|Height) and element_style.(width|height)
No description provided.